/**
*  \file specs_hw.c
*
*  \brief
*
*  \author Li Dajin  <Dajin.Li@Linde-China.com>
*
*
*/

/*===============================================[ private includes  ]================================================*/
#include "specs_hw.h"

/*===============================================[ private defines   ]================================================*/

/*===============================================[ private datatypes ]================================================*/

/*===============================================[ private variables ]================================================*/


const HW_SPECS Specs_hw_48V =
{
    /* F32   ADC_Resol_UBat         */    0.083741f           /* [Volt/Digit]   (see Ecu.xmcd)                                                      */
    /* F32   ADC_Resol_Curr         */ ,  0.009775171f        /* [Ampere/Digit] (see Ecu.xmcd)                                                      */
    /* F32   ADC_Resol_Curr_op      */ ,  0.000977517f        /* [Ampere/Digit] (see Ecu.xmcd)                                                      */
    
    /* F32   ADC_Resol_13V          */ ,  0.015173f           /* A/D-C resolution in Volt for signals with 13V nominal magnitude    (see Ecu.xmcd)  */
    /* F32   ADC_Resol_5V           */ ,  0.005311f           /* A/D-C resolution in Volt for signals with  5V nominal magnitude    (see Ecu.xmcd)  */
    /* F32   ADC_Resol_Relsts       */ ,  0.023607f           /* A/D-C resolution in Volt for relay  status signal                  (see Ecu.xmcd)  */
    /* F32   ADC_Resol_Outsts       */ ,  0.009775f           /* A/D-C resolution in Volt for output status signal                  (see Ecu.xmcd)  */
    
    /* F32   ConNomVolt             */ ,  24.0f               /* nominal mean voltage upon contactor solenoid                                       */
    /* F32   DelBatCapVolt          */ ,  3.0f                /* allowed voltage drop at the contactor between battery and capacitor voltage        */
    
    /* S16   Cal_Umin_BDI_value     */ ,  780                 /* [digits] range: min          */
    /* S16   Cal_Umax_BDI_value     */ ,  860                 /* [digits] range: max          */
    /* F32   Cal_Ucal_BDI_value     */ ,  48.0f               /* [Volt]                       */
    /* F32   Cal_Udef_BDI_Resol     */ ,  0.058651f           /* [Volt/digits] (see Ecu.xmcd) */
    
    /* S16   Cal_Umin_1MX_value     */ ,  720                 /* [digits] range: min          */
    /* S16   Cal_Umax_1MX_value     */ ,  800                 /* [digits] range: max          */
    /* F32   Cal_Ucal_1MX_value     */ ,  56.242f             /* [Volt]                       */
    /* F32   Cal_Udef_1MX_Resol     */ ,  0.073705f           /* [Volt/digits] (see Ecu.xmcd) */
    
    /* F32   UPull_In_CMAIN         */ ,  48.0f               /* [Volt] */
    /* F32   UNominal_CMAIN         */ ,  24.0f               /* [Volt] */
    
    /* F32   UPull_In_BrValve       */ ,  48.0f               /* [Volt] */
    /* F32   UNominal_BrValve       */ ,  36.0f               /* [Volt] */
};


const HW_SPECS Specs_hw_80V =
{
    /* F32   ADC_Resol_UBat         */    0.124033f           /* [Volt/Digit]   (see Ecu.xmcd)                                                      */
    /* F32   ADC_Resol_Curr         */ ,  0.004887586f        /* [Ampere/Digit] (see Ecu.xmcd)                                                      */
    /* F32   ADC_Resol_Curr_op      */ ,  0.000734975f        /* [Ampere/Digit] (see Ecu.xmcd) LDC70/20                                             */
    
    /* F32   ADC_Resol_13V          */ ,  0.015173f           /* A/D-C resolution in Volt for signals with 13V nominal magnitude    (see Ecu.xmcd)  */
    /* F32   ADC_Resol_5V           */ ,  0.005311f           /* A/D-C resolution in Volt for signals with  5V nominal magnitude    (see Ecu.xmcd)  */
    /* F32   ADC_Resol_Relsts       */ ,  0.023607f           /* A/D-C resolution in Volt for relay  status signal                  (see Ecu.xmcd)  */
    /* F32   ADC_Resol_Outsts       */ ,  0.009775f           /* A/D-C resolution in Volt for output status signal                  (see Ecu.xmcd)  */
    
    /* F32   ConNomVolt             */ ,  24.0f               /* nominal mean voltage upon contactor solenoid                                       */
    /* F32   DelBatCapVolt          */ ,  4.0f                /* allowed voltage drop at the contactor between battery and capacitor voltage        */
    
    /* S16   Cal_Umin_BDI_value     */ ,  570                 /* [digits] range: min          */
    /* S16   Cal_Umax_BDI_value     */ ,  630                 /* [digits] range: max          */
    /* F32   Cal_Ucal_BDI_value     */ ,  80.0f               /* [Volt]                       */
    /* F32   Cal_Udef_BDI_Resol     */ ,  0.132717f           /* [Volt/digits] (see Ecu.xmcd) */
    
    /* S16   Cal_Umin_1MX_value     */ ,  715                 /* [digits] range: min          */
    /* S16   Cal_Umax_1MX_value     */ ,  790                 /* [digits] range: max          */
    /* F32   Cal_Ucal_1MX_value     */ ,  94.539f             /* [Volt]                       */
    /* F32   Cal_Udef_1MX_Resol     */ ,  0.125419f           /* [Volt/digits] (see Ecu.xmcd) */
    
    /* F32   UPull_In_CMAIN         */ ,  48.0f               /* [Volt] */
    /* F32   UNominal_CMAIN         */ ,  24.0f               /* [Volt] */
    
    /* F32   UPull_In_BrValve       */ ,  80.0f               /* [Volt] */
    /* F32   UNominal_BrValve       */ ,  65.0f               /* [Volt] */
};


/*===============================================[ public variables  ]================================================*/

const  HW_SPECS*     specs_hw = &Specs_hw_48V;

/*===============================================[ private functions ]================================================*/

/*====================================================================================================================*/


/**
*  Initialization.
*
*  Initialize the input module.
*
*  \return RC_SUCCESS if successful.
*/
RC specs_initialize_hardware(S16 battery_type)
{
   /* Initialization specs_hw-pointer */
   if ( battery_type == S16_CONST(48) )
   {
      specs_hw = &Specs_hw_48V;
   }
   else
   {
      specs_hw = &Specs_hw_80V;
   }

   return RC_SUCCESS;
}


/***********************************************************************************************************************
*                             Copyright 2013 Linde Material Handling. All rights reserved.                             *
***********************************************************************************************************************/

